
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for comQuerypri.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="comQuerypriForm"
 */
public class ComQuerypriForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cqpGuid = null;
   private java.lang.String _tableName = null;
   private java.lang.String _fieldName = null;
   private java.lang.String _condition = null;
   private java.lang.String _state = null;

   /**
    * Standard constructor.
    */
   public ComQuerypriForm() {
   }

   /**
    * Returns the cqpGuid
    *
    * @return the cqpGuid
    */
   public java.lang.String getCqpGuid() {
      return _cqpGuid;
   }

   /**
    * Sets the cqpGuid
    *
    * @param cqpGuid the new cqpGuid value
    */
   public void setCqpGuid(java.lang.String cqpGuid) {
      _cqpGuid = cqpGuid;
   }
   /**
    * Returns the tableName
    *
    * @return the tableName
    */
   public java.lang.String getTableName() {
      return _tableName;
   }

   /**
    * Sets the tableName
    *
    * @param tableName the new tableName value
    */
   public void setTableName(java.lang.String tableName) {
      _tableName = tableName;
   }
   /**
    * Returns the fieldName
    *
    * @return the fieldName
    */
   public java.lang.String getFieldName() {
      return _fieldName;
   }

   /**
    * Sets the fieldName
    *
    * @param fieldName the new fieldName value
    */
   public void setFieldName(java.lang.String fieldName) {
      _fieldName = fieldName;
   }
   /**
    * Returns the condition
    *
    * @return the condition
    */
   public java.lang.String getCondition() {
      return _condition;
   }

   /**
    * Sets the condition
    *
    * @param condition the new condition value
    */
   public void setCondition(java.lang.String condition) {
      _condition = condition;
   }
   /**
    * Returns the state
    *
    * @return the state
    */
   public java.lang.String getState() {
      return _state;
   }

   /**
    * Sets the state
    *
    * @param state the new state value
    */
   public void setState(java.lang.String state) {
      _state = state;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCqpGuid() == null) {
         errors.add("cqpGuid", new ActionError("error.cqpGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
